package com.app.common.dataDictionary.PO;

import java.util.*;
import com.css.sword.kernel.base.annotation.*;
import com.css.sword.kernel.base.dataElement.*;
import com.css.sword.kernel.base.exception.SwordBaseCheckedException;

import com.app.common.dataDictionary.DE.DE_CATEGORY_ID;
import com.app.common.dataDictionary.DE.DE_CATEGORY_TITLE;
import com.app.common.dataDictionary.DE.DE_CATEGORY_SORTNUM;
import com.app.common.dataDictionary.DE.DE_CATEGORY_OPPTIME;
import com.app.common.dataDictionary.DE.DE_CATEGORY_SFNEW;
import com.app.common.dataDictionary.DE.DE_CATEGORY_IMGDOMAIN;
import com.app.common.dataDictionary.DE.DE_CATEGORY_LITTLEIMGID;
import com.app.common.dataDictionary.DE.DE_CATEGORY_BIGIMGID;
import com.app.common.dataDictionary.DE.DE_CATEGORY_LITTLEIMGNAME;
import com.app.common.dataDictionary.DE.DE_CATEGORY_BIGIMGNAME;
import com.app.common.dataDictionary.DE.DE_CATEGORY_LITTLEIMGPATH;
import com.app.common.dataDictionary.DE.DE_CATEGORY_BIGIMGPATH;
import com.app.common.dataDictionary.DE.DE_CATEGORY_LITTLEIMGSIZE;
import com.app.common.dataDictionary.DE.DE_CATEGORY_BIGIMGSIZE;


/**
 * 分类表; InnoDB free: 10240 kB
 */
@PersistObject
public class TCategoryPO extends AbsPersistObject {
	//private static final long serialVersionUID = 2715533043924134129L;
	private static final long serialVersionUID = 1L;
	private static final Map<String, Integer> fieldIndex = new HashMap<String, Integer>(14);
	private static final BitSet HAS_DEFAULT_VALUE = new BitSet(14);
	
	static{
		HAS_DEFAULT_VALUE.set(2, true);HAS_DEFAULT_VALUE.set(4, true);
		fieldIndex.put("categoryId",0);fieldIndex.put("categoryTitle",1);fieldIndex.put("categorySortnum",2);fieldIndex.put("categoryOpptime",3);fieldIndex.put("categorySfnew",4);fieldIndex.put("categoryImgdomain",5);fieldIndex.put("categoryLittleimgid",6);fieldIndex.put("categoryBigimgid",7);fieldIndex.put("categoryLittleimgname",8);fieldIndex.put("categoryBigimgname",9);fieldIndex.put("categoryLittleimgpath",10);fieldIndex.put("categoryBigimgpath",11);fieldIndex.put("categoryLittleimgsize",12);fieldIndex.put("categoryBigimgsize",13);
	}
	
	/**
	 * 物理表名
	 */
	public static final String TABLE_NAME = "t_category";

	/**
	 * 分类id
	 */
	private DE_CATEGORY_ID categoryId = DE_CATEGORY_ID.getTemplateInstance();

	/**
	 * 分类title
	 */
	private DE_CATEGORY_TITLE categoryTitle = DE_CATEGORY_TITLE.getTemplateInstance();

	/**
	 * 客户端首页分类排序号
	 */
	private DE_CATEGORY_SORTNUM categorySortnum = DE_CATEGORY_SORTNUM.getTemplateInstance();

	/**
	 * 分类最后一次操作时间
	 */
	private DE_CATEGORY_OPPTIME categoryOpptime = DE_CATEGORY_OPPTIME.getTemplateInstance();

	/**
	 * 分类是否new
	 */
	private DE_CATEGORY_SFNEW categorySfnew = DE_CATEGORY_SFNEW.getTemplateInstance();

	/**
	 * 分类图标上传主路径
	 */
	private DE_CATEGORY_IMGDOMAIN categoryImgdomain = DE_CATEGORY_IMGDOMAIN.getTemplateInstance();

	/**
	 * 分类小图标id
	 */
	private DE_CATEGORY_LITTLEIMGID categoryLittleimgid = DE_CATEGORY_LITTLEIMGID.getTemplateInstance();

	/**
	 * 分类大图标id
	 */
	private DE_CATEGORY_BIGIMGID categoryBigimgid = DE_CATEGORY_BIGIMGID.getTemplateInstance();

	/**
	 * 分类小图标name
	 */
	private DE_CATEGORY_LITTLEIMGNAME categoryLittleimgname = DE_CATEGORY_LITTLEIMGNAME.getTemplateInstance();

	/**
	 * 分类大图标name
	 */
	private DE_CATEGORY_BIGIMGNAME categoryBigimgname = DE_CATEGORY_BIGIMGNAME.getTemplateInstance();

	/**
	 * 分类小图标上传路径
	 */
	private DE_CATEGORY_LITTLEIMGPATH categoryLittleimgpath = DE_CATEGORY_LITTLEIMGPATH.getTemplateInstance();

	/**
	 * 分类大图标上传路径
	 */
	private DE_CATEGORY_BIGIMGPATH categoryBigimgpath = DE_CATEGORY_BIGIMGPATH.getTemplateInstance();

	/**
	 * 分类小图标上传大小
	 */
	private DE_CATEGORY_LITTLEIMGSIZE categoryLittleimgsize = DE_CATEGORY_LITTLEIMGSIZE.getTemplateInstance();

	/**
	 * 分类大图标上传大小
	 */
	private DE_CATEGORY_BIGIMGSIZE categoryBigimgsize = DE_CATEGORY_BIGIMGSIZE.getTemplateInstance();


	public TCategoryPO(){
		this.insertState = new BitSet(14);
		this.updateState = new BitSet(14);
	}

	
	/**
	 * 获取 "分类id" 值
	 */	
	public DE_CATEGORY_ID getCategoryId(){
		return  categoryId;
	}
	
	/**
	 * 设置 "分类id" 值
	 */
	public void setCategoryId(DE_CATEGORY_ID categoryId) {
		if(categoryId == null){
			categoryId= DE_CATEGORY_ID.getTemplateInstance();
		}
		recordChangeFlag(0);
		this.categoryId = categoryId;
	}
	
	/**
	 * 获取 "分类title" 值
	 */	
	public DE_CATEGORY_TITLE getCategoryTitle(){
		return  categoryTitle;
	}
	
	/**
	 * 设置 "分类title" 值
	 */
	public void setCategoryTitle(DE_CATEGORY_TITLE categoryTitle) {
		if(categoryTitle == null){
			categoryTitle= DE_CATEGORY_TITLE.getTemplateInstance();
		}
		recordChangeFlag(1);
		this.categoryTitle = categoryTitle;
	}
	
	/**
	 * 获取 "客户端首页分类排序号" 值
	 */	
	public DE_CATEGORY_SORTNUM getCategorySortnum(){
		return  categorySortnum;
	}
	
	/**
	 * 设置 "客户端首页分类排序号" 值
	 */
	public void setCategorySortnum(DE_CATEGORY_SORTNUM categorySortnum) {
		if(categorySortnum == null){
			categorySortnum= DE_CATEGORY_SORTNUM.getTemplateInstance();
		}
		recordChangeFlag(2);
		this.categorySortnum = categorySortnum;
	}
	
	/**
	 * 获取 "分类最后一次操作时间" 值
	 */	
	public DE_CATEGORY_OPPTIME getCategoryOpptime(){
		return  categoryOpptime;
	}
	
	/**
	 * 设置 "分类最后一次操作时间" 值
	 */
	public void setCategoryOpptime(DE_CATEGORY_OPPTIME categoryOpptime) {
		if(categoryOpptime == null){
			categoryOpptime= DE_CATEGORY_OPPTIME.getTemplateInstance();
		}
		recordChangeFlag(3);
		this.categoryOpptime = categoryOpptime;
	}
	
	/**
	 * 获取 "分类是否new" 值
	 */	
	public DE_CATEGORY_SFNEW getCategorySfnew(){
		return  categorySfnew;
	}
	
	/**
	 * 设置 "分类是否new" 值
	 */
	public void setCategorySfnew(DE_CATEGORY_SFNEW categorySfnew) {
		if(categorySfnew == null){
			categorySfnew= DE_CATEGORY_SFNEW.getTemplateInstance();
		}
		recordChangeFlag(4);
		this.categorySfnew = categorySfnew;
	}
	
	/**
	 * 获取 "分类图标上传主路径" 值
	 */	
	public DE_CATEGORY_IMGDOMAIN getCategoryImgdomain(){
		return  categoryImgdomain;
	}
	
	/**
	 * 设置 "分类图标上传主路径" 值
	 */
	public void setCategoryImgdomain(DE_CATEGORY_IMGDOMAIN categoryImgdomain) {
		if(categoryImgdomain == null){
			categoryImgdomain= DE_CATEGORY_IMGDOMAIN.getTemplateInstance();
		}
		recordChangeFlag(5);
		this.categoryImgdomain = categoryImgdomain;
	}
	
	/**
	 * 获取 "分类小图标id" 值
	 */	
	public DE_CATEGORY_LITTLEIMGID getCategoryLittleimgid(){
		return  categoryLittleimgid;
	}
	
	/**
	 * 设置 "分类小图标id" 值
	 */
	public void setCategoryLittleimgid(DE_CATEGORY_LITTLEIMGID categoryLittleimgid) {
		if(categoryLittleimgid == null){
			categoryLittleimgid= DE_CATEGORY_LITTLEIMGID.getTemplateInstance();
		}
		recordChangeFlag(6);
		this.categoryLittleimgid = categoryLittleimgid;
	}
	
	/**
	 * 获取 "分类大图标id" 值
	 */	
	public DE_CATEGORY_BIGIMGID getCategoryBigimgid(){
		return  categoryBigimgid;
	}
	
	/**
	 * 设置 "分类大图标id" 值
	 */
	public void setCategoryBigimgid(DE_CATEGORY_BIGIMGID categoryBigimgid) {
		if(categoryBigimgid == null){
			categoryBigimgid= DE_CATEGORY_BIGIMGID.getTemplateInstance();
		}
		recordChangeFlag(7);
		this.categoryBigimgid = categoryBigimgid;
	}
	
	/**
	 * 获取 "分类小图标name" 值
	 */	
	public DE_CATEGORY_LITTLEIMGNAME getCategoryLittleimgname(){
		return  categoryLittleimgname;
	}
	
	/**
	 * 设置 "分类小图标name" 值
	 */
	public void setCategoryLittleimgname(DE_CATEGORY_LITTLEIMGNAME categoryLittleimgname) {
		if(categoryLittleimgname == null){
			categoryLittleimgname= DE_CATEGORY_LITTLEIMGNAME.getTemplateInstance();
		}
		recordChangeFlag(8);
		this.categoryLittleimgname = categoryLittleimgname;
	}
	
	/**
	 * 获取 "分类大图标name" 值
	 */	
	public DE_CATEGORY_BIGIMGNAME getCategoryBigimgname(){
		return  categoryBigimgname;
	}
	
	/**
	 * 设置 "分类大图标name" 值
	 */
	public void setCategoryBigimgname(DE_CATEGORY_BIGIMGNAME categoryBigimgname) {
		if(categoryBigimgname == null){
			categoryBigimgname= DE_CATEGORY_BIGIMGNAME.getTemplateInstance();
		}
		recordChangeFlag(9);
		this.categoryBigimgname = categoryBigimgname;
	}
	
	/**
	 * 获取 "分类小图标上传路径" 值
	 */	
	public DE_CATEGORY_LITTLEIMGPATH getCategoryLittleimgpath(){
		return  categoryLittleimgpath;
	}
	
	/**
	 * 设置 "分类小图标上传路径" 值
	 */
	public void setCategoryLittleimgpath(DE_CATEGORY_LITTLEIMGPATH categoryLittleimgpath) {
		if(categoryLittleimgpath == null){
			categoryLittleimgpath= DE_CATEGORY_LITTLEIMGPATH.getTemplateInstance();
		}
		recordChangeFlag(10);
		this.categoryLittleimgpath = categoryLittleimgpath;
	}
	
	/**
	 * 获取 "分类大图标上传路径" 值
	 */	
	public DE_CATEGORY_BIGIMGPATH getCategoryBigimgpath(){
		return  categoryBigimgpath;
	}
	
	/**
	 * 设置 "分类大图标上传路径" 值
	 */
	public void setCategoryBigimgpath(DE_CATEGORY_BIGIMGPATH categoryBigimgpath) {
		if(categoryBigimgpath == null){
			categoryBigimgpath= DE_CATEGORY_BIGIMGPATH.getTemplateInstance();
		}
		recordChangeFlag(11);
		this.categoryBigimgpath = categoryBigimgpath;
	}
	
	/**
	 * 获取 "分类小图标上传大小" 值
	 */	
	public DE_CATEGORY_LITTLEIMGSIZE getCategoryLittleimgsize(){
		return  categoryLittleimgsize;
	}
	
	/**
	 * 设置 "分类小图标上传大小" 值
	 */
	public void setCategoryLittleimgsize(DE_CATEGORY_LITTLEIMGSIZE categoryLittleimgsize) {
		if(categoryLittleimgsize == null){
			categoryLittleimgsize= DE_CATEGORY_LITTLEIMGSIZE.getTemplateInstance();
		}
		recordChangeFlag(12);
		this.categoryLittleimgsize = categoryLittleimgsize;
	}
	
	/**
	 * 获取 "分类大图标上传大小" 值
	 */	
	public DE_CATEGORY_BIGIMGSIZE getCategoryBigimgsize(){
		return  categoryBigimgsize;
	}
	
	/**
	 * 设置 "分类大图标上传大小" 值
	 */
	public void setCategoryBigimgsize(DE_CATEGORY_BIGIMGSIZE categoryBigimgsize) {
		if(categoryBigimgsize == null){
			categoryBigimgsize= DE_CATEGORY_BIGIMGSIZE.getTemplateInstance();
		}
		recordChangeFlag(13);
		this.categoryBigimgsize = categoryBigimgsize;
	}


	@Override
	public BaseDataElement<?>[] fields(){
		return new BaseDataElement<?>[] {categoryId,categoryTitle,categorySortnum,categoryOpptime,categorySfnew,categoryImgdomain,categoryLittleimgid,categoryBigimgid,categoryLittleimgname,categoryBigimgname,categoryLittleimgpath,categoryBigimgpath,categoryLittleimgsize,categoryBigimgsize};
	}
	
	@Override
	public String[] fieldNames() {
		return new String[]{"categoryId","categoryTitle","categorySortnum","categoryOpptime","categorySfnew","categoryImgdomain","categoryLittleimgid","categoryBigimgid","categoryLittleimgname","categoryBigimgname","categoryLittleimgpath","categoryBigimgpath","categoryLittleimgsize","categoryBigimgsize"};
	}
	
	@Override
	public BaseDataElement<?> getFieldValue(String fieldName)  {
		final Integer index = fieldIndex.get(fieldName);
		if (index == null) {
			throw new IllegalArgumentException("PO对象中没有" + fieldName + "字段");
		}
		switch (index) {
		case 0 : return categoryId;
		case 1 : return categoryTitle;
		case 2 : return categorySortnum;
		case 3 : return categoryOpptime;
		case 4 : return categorySfnew;
		case 5 : return categoryImgdomain;
		case 6 : return categoryLittleimgid;
		case 7 : return categoryBigimgid;
		case 8 : return categoryLittleimgname;
		case 9 : return categoryBigimgname;
		case 10 : return categoryLittleimgpath;
		case 11 : return categoryBigimgpath;
		case 12 : return categoryLittleimgsize;
		case 13 : return categoryBigimgsize;
 
		default:
			throw new IllegalArgumentException("PO对象中没有" + fieldName + "字段");
		}
	}
	
	@Override
	public TCategoryPO setFieldValue(String fieldName, Object fieldValue) throws SwordBaseCheckedException {
		if (fieldValue != null && !(fieldValue instanceof BaseDataElement<?>)) {
			throw new SwordBaseCheckedException("字段值类型不是DataElelement子类型");
		}

		final Integer index = fieldIndex.get(fieldName);
		if (index == null) {
			throw new SwordBaseCheckedException("PO对象中没有" + fieldName + "字段");
		}

		switch (index) {

				case 0 : {
					if (fieldValue == null) {
						setCategoryId(null);
					} else {
						setCategoryId((DE_CATEGORY_ID) fieldValue);
					}
					return this;
				}
				
				case 1 : {
					if (fieldValue == null) {
						setCategoryTitle(null);
					} else {
						setCategoryTitle((DE_CATEGORY_TITLE) fieldValue);
					}
					return this;
				}
				
				case 2 : {
					if (fieldValue == null) {
						setCategorySortnum(null);
					} else {
						setCategorySortnum((DE_CATEGORY_SORTNUM) fieldValue);
					}
					return this;
				}
				
				case 3 : {
					if (fieldValue == null) {
						setCategoryOpptime(null);
					} else {
						setCategoryOpptime((DE_CATEGORY_OPPTIME) fieldValue);
					}
					return this;
				}
				
				case 4 : {
					if (fieldValue == null) {
						setCategorySfnew(null);
					} else {
						setCategorySfnew((DE_CATEGORY_SFNEW) fieldValue);
					}
					return this;
				}
				
				case 5 : {
					if (fieldValue == null) {
						setCategoryImgdomain(null);
					} else {
						setCategoryImgdomain((DE_CATEGORY_IMGDOMAIN) fieldValue);
					}
					return this;
				}
				
				case 6 : {
					if (fieldValue == null) {
						setCategoryLittleimgid(null);
					} else {
						setCategoryLittleimgid((DE_CATEGORY_LITTLEIMGID) fieldValue);
					}
					return this;
				}
				
				case 7 : {
					if (fieldValue == null) {
						setCategoryBigimgid(null);
					} else {
						setCategoryBigimgid((DE_CATEGORY_BIGIMGID) fieldValue);
					}
					return this;
				}
				
				case 8 : {
					if (fieldValue == null) {
						setCategoryLittleimgname(null);
					} else {
						setCategoryLittleimgname((DE_CATEGORY_LITTLEIMGNAME) fieldValue);
					}
					return this;
				}
				
				case 9 : {
					if (fieldValue == null) {
						setCategoryBigimgname(null);
					} else {
						setCategoryBigimgname((DE_CATEGORY_BIGIMGNAME) fieldValue);
					}
					return this;
				}
				
				case 10 : {
					if (fieldValue == null) {
						setCategoryLittleimgpath(null);
					} else {
						setCategoryLittleimgpath((DE_CATEGORY_LITTLEIMGPATH) fieldValue);
					}
					return this;
				}
				
				case 11 : {
					if (fieldValue == null) {
						setCategoryBigimgpath(null);
					} else {
						setCategoryBigimgpath((DE_CATEGORY_BIGIMGPATH) fieldValue);
					}
					return this;
				}
				
				case 12 : {
					if (fieldValue == null) {
						setCategoryLittleimgsize(null);
					} else {
						setCategoryLittleimgsize((DE_CATEGORY_LITTLEIMGSIZE) fieldValue);
					}
					return this;
				}
				
				case 13 : {
					if (fieldValue == null) {
						setCategoryBigimgsize(null);
					} else {
						setCategoryBigimgsize((DE_CATEGORY_BIGIMGSIZE) fieldValue);
					}
					return this;
				}
				
		default:
			throw new SwordBaseCheckedException("PO对象中没有" + fieldName + "字段");
		}
	
	}

	@Override
	protected TCategoryPO clone() {
		TCategoryPO t = new TCategoryPO();
		
		t.setCategoryId(this.categoryId);
		t.setCategoryTitle(this.categoryTitle);
		t.setCategorySortnum(this.categorySortnum);
		t.setCategoryOpptime(this.categoryOpptime);
		t.setCategorySfnew(this.categorySfnew);
		t.setCategoryImgdomain(this.categoryImgdomain);
		t.setCategoryLittleimgid(this.categoryLittleimgid);
		t.setCategoryBigimgid(this.categoryBigimgid);
		t.setCategoryLittleimgname(this.categoryLittleimgname);
		t.setCategoryBigimgname(this.categoryBigimgname);
		t.setCategoryLittleimgpath(this.categoryLittleimgpath);
		t.setCategoryBigimgpath(this.categoryBigimgpath);
		t.setCategoryLittleimgsize(this.categoryLittleimgsize);
		t.setCategoryBigimgsize(this.categoryBigimgsize);

		return t;
	}

	@Override
	public TCategoryPO loadMap(Map<String, Object> dataMap) throws SwordBaseCheckedException {
		Object value = null;

		if(dataMap.containsKey("categoryId")){
			value = dataMap.get("categoryId");
			
			if (value == null) {
				this.setCategoryId(null);
			} else {
				if (value instanceof DE_CATEGORY_ID) {
					this.setCategoryId((DE_CATEGORY_ID) value);
				}
			    else {
					this.setCategoryId(new DE_CATEGORY_ID(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryTitle")){
			value = dataMap.get("categoryTitle");
			
			if (value == null) {
				this.setCategoryTitle(null);
			} else {
				if (value instanceof DE_CATEGORY_TITLE) {
					this.setCategoryTitle((DE_CATEGORY_TITLE) value);
				}
			    else {
					this.setCategoryTitle(new DE_CATEGORY_TITLE(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categorySortnum")){
			value = dataMap.get("categorySortnum");
			
			if (value == null) {
				this.setCategorySortnum(null);
			} else {
				if (value instanceof DE_CATEGORY_SORTNUM) {
					this.setCategorySortnum((DE_CATEGORY_SORTNUM) value);
				}
			    else {
					this.setCategorySortnum(new DE_CATEGORY_SORTNUM(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryOpptime")){
			value = dataMap.get("categoryOpptime");
			
			if (value == null) {
				this.setCategoryOpptime(null);
			} else {
				if (value instanceof DE_CATEGORY_OPPTIME) {
					this.setCategoryOpptime((DE_CATEGORY_OPPTIME) value);
				}
				else if(value instanceof java.util.Date){
					this.setCategoryOpptime(new DE_CATEGORY_OPPTIME((java.util.Date)value));
				}
			    else {
					this.setCategoryOpptime(new DE_CATEGORY_OPPTIME(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categorySfnew")){
			value = dataMap.get("categorySfnew");
			
			if (value == null) {
				this.setCategorySfnew(null);
			} else {
				if (value instanceof DE_CATEGORY_SFNEW) {
					this.setCategorySfnew((DE_CATEGORY_SFNEW) value);
				}
			    else {
					this.setCategorySfnew(new DE_CATEGORY_SFNEW(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryImgdomain")){
			value = dataMap.get("categoryImgdomain");
			
			if (value == null) {
				this.setCategoryImgdomain(null);
			} else {
				if (value instanceof DE_CATEGORY_IMGDOMAIN) {
					this.setCategoryImgdomain((DE_CATEGORY_IMGDOMAIN) value);
				}
			    else {
					this.setCategoryImgdomain(new DE_CATEGORY_IMGDOMAIN(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryLittleimgid")){
			value = dataMap.get("categoryLittleimgid");
			
			if (value == null) {
				this.setCategoryLittleimgid(null);
			} else {
				if (value instanceof DE_CATEGORY_LITTLEIMGID) {
					this.setCategoryLittleimgid((DE_CATEGORY_LITTLEIMGID) value);
				}
			    else {
					this.setCategoryLittleimgid(new DE_CATEGORY_LITTLEIMGID(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryBigimgid")){
			value = dataMap.get("categoryBigimgid");
			
			if (value == null) {
				this.setCategoryBigimgid(null);
			} else {
				if (value instanceof DE_CATEGORY_BIGIMGID) {
					this.setCategoryBigimgid((DE_CATEGORY_BIGIMGID) value);
				}
			    else {
					this.setCategoryBigimgid(new DE_CATEGORY_BIGIMGID(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryLittleimgname")){
			value = dataMap.get("categoryLittleimgname");
			
			if (value == null) {
				this.setCategoryLittleimgname(null);
			} else {
				if (value instanceof DE_CATEGORY_LITTLEIMGNAME) {
					this.setCategoryLittleimgname((DE_CATEGORY_LITTLEIMGNAME) value);
				}
			    else {
					this.setCategoryLittleimgname(new DE_CATEGORY_LITTLEIMGNAME(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryBigimgname")){
			value = dataMap.get("categoryBigimgname");
			
			if (value == null) {
				this.setCategoryBigimgname(null);
			} else {
				if (value instanceof DE_CATEGORY_BIGIMGNAME) {
					this.setCategoryBigimgname((DE_CATEGORY_BIGIMGNAME) value);
				}
			    else {
					this.setCategoryBigimgname(new DE_CATEGORY_BIGIMGNAME(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryLittleimgpath")){
			value = dataMap.get("categoryLittleimgpath");
			
			if (value == null) {
				this.setCategoryLittleimgpath(null);
			} else {
				if (value instanceof DE_CATEGORY_LITTLEIMGPATH) {
					this.setCategoryLittleimgpath((DE_CATEGORY_LITTLEIMGPATH) value);
				}
			    else {
					this.setCategoryLittleimgpath(new DE_CATEGORY_LITTLEIMGPATH(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryBigimgpath")){
			value = dataMap.get("categoryBigimgpath");
			
			if (value == null) {
				this.setCategoryBigimgpath(null);
			} else {
				if (value instanceof DE_CATEGORY_BIGIMGPATH) {
					this.setCategoryBigimgpath((DE_CATEGORY_BIGIMGPATH) value);
				}
			    else {
					this.setCategoryBigimgpath(new DE_CATEGORY_BIGIMGPATH(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryLittleimgsize")){
			value = dataMap.get("categoryLittleimgsize");
			
			if (value == null) {
				this.setCategoryLittleimgsize(null);
			} else {
				if (value instanceof DE_CATEGORY_LITTLEIMGSIZE) {
					this.setCategoryLittleimgsize((DE_CATEGORY_LITTLEIMGSIZE) value);
				}
			    else {
					this.setCategoryLittleimgsize(new DE_CATEGORY_LITTLEIMGSIZE(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("categoryBigimgsize")){
			value = dataMap.get("categoryBigimgsize");
			
			if (value == null) {
				this.setCategoryBigimgsize(null);
			} else {
				if (value instanceof DE_CATEGORY_BIGIMGSIZE) {
					this.setCategoryBigimgsize((DE_CATEGORY_BIGIMGSIZE) value);
				}
			    else {
					this.setCategoryBigimgsize(new DE_CATEGORY_BIGIMGSIZE(value.toString()));
				}
			}
		}

		return this;
	}
	
	@Override
	public Map<String,Object> toMap() {
		Map<String,Object> dataMap = new HashMap<String,Object>();

		dataMap.put("categoryId", categoryId);
		dataMap.put("categoryTitle", categoryTitle);
		dataMap.put("categorySortnum", categorySortnum);
		dataMap.put("categoryOpptime", categoryOpptime);
		dataMap.put("categorySfnew", categorySfnew);
		dataMap.put("categoryImgdomain", categoryImgdomain);
		dataMap.put("categoryLittleimgid", categoryLittleimgid);
		dataMap.put("categoryBigimgid", categoryBigimgid);
		dataMap.put("categoryLittleimgname", categoryLittleimgname);
		dataMap.put("categoryBigimgname", categoryBigimgname);
		dataMap.put("categoryLittleimgpath", categoryLittleimgpath);
		dataMap.put("categoryBigimgpath", categoryBigimgpath);
		dataMap.put("categoryLittleimgsize", categoryLittleimgsize);
		dataMap.put("categoryBigimgsize", categoryBigimgsize);
		
		return dataMap;
	}
	
	@Override
	public Map<String,Object> toMapWithDEValue() {
		Map<String,Object> dataMap = new HashMap<String,Object>();

		dataMap.put("categoryId", (categoryId==null?null:categoryId.value));
		dataMap.put("categoryTitle", (categoryTitle==null?null:categoryTitle.value));
		dataMap.put("categorySortnum", (categorySortnum==null?null:categorySortnum.value));
		dataMap.put("categoryOpptime", (categoryOpptime==null?null:categoryOpptime.value));
		dataMap.put("categorySfnew", (categorySfnew==null?null:categorySfnew.value));
		dataMap.put("categoryImgdomain", (categoryImgdomain==null?null:categoryImgdomain.value));
		dataMap.put("categoryLittleimgid", (categoryLittleimgid==null?null:categoryLittleimgid.value));
		dataMap.put("categoryBigimgid", (categoryBigimgid==null?null:categoryBigimgid.value));
		dataMap.put("categoryLittleimgname", (categoryLittleimgname==null?null:categoryLittleimgname.value));
		dataMap.put("categoryBigimgname", (categoryBigimgname==null?null:categoryBigimgname.value));
		dataMap.put("categoryLittleimgpath", (categoryLittleimgpath==null?null:categoryLittleimgpath.value));
		dataMap.put("categoryBigimgpath", (categoryBigimgpath==null?null:categoryBigimgpath.value));
		dataMap.put("categoryLittleimgsize", (categoryLittleimgsize==null?null:categoryLittleimgsize.value));
		dataMap.put("categoryBigimgsize", (categoryBigimgsize==null?null:categoryBigimgsize.value));
		
		return dataMap;
	}
	
	@Override
	public TCategoryPO newInstance() {
		return new TCategoryPO();
	}
	
	@Override
	public String getTableName(){
		return TABLE_NAME;
	}
	
	@Override
	public BaseDataElement<?>[] getPrimaryKey() {
		return new BaseDataElement<?>[]{categoryId};
	}

	@Override
	public void checkNotNull(byte sqlType) throws SwordBaseCheckedException {
		StringBuilder errorMsg = new StringBuilder();
		// insert
		if (sqlType == 0) {
				//只校验不可为空但又没有默认值的字段
				if (categoryId.value == null && !HAS_DEFAULT_VALUE.get(0)) {
					errorMsg.append("字段categoryId不允许为空\n");
				}
				if (categoryTitle.value == null && !HAS_DEFAULT_VALUE.get(1)) {
					errorMsg.append("字段categoryTitle不允许为空\n");
				}

		}
		// update
		else if (sqlType == 1) {
		if (updateState.get(0) && categoryId.value == null) {
			errorMsg.append("字段categoryId不允许为空\n");
		}
		if (updateState.get(1) && categoryTitle.value == null) {
			errorMsg.append("字段categoryTitle不允许为空\n");
		}

		}
		
		if (errorMsg.length() > 0) {
			errorMsg.setLength(errorMsg.length() - 1);
			throw new SwordBaseCheckedException(errorMsg.toString());
		}
	}

	@Override
	public void updateLrrq(DateDE lrrq) {
	}

	@Override
	public void updateXgrq(DateDE xgrq) {
	}

	@Override
	public String toString() {
		StringBuilder str = new StringBuilder();
		str.append("categoryId:").append(categoryId.value!=null?categoryId:"").append(" ").append("categoryTitle:").append(categoryTitle.value!=null?categoryTitle:"").append(" ").append("categorySortnum:").append(categorySortnum.value!=null?categorySortnum:"").append(" ").append("categoryOpptime:").append(categoryOpptime.value!=null?categoryOpptime:"").append(" ").append("categorySfnew:").append(categorySfnew.value!=null?categorySfnew:"").append(" ").append("categoryImgdomain:").append(categoryImgdomain.value!=null?categoryImgdomain:"").append(" ").append("categoryLittleimgid:").append(categoryLittleimgid.value!=null?categoryLittleimgid:"").append(" ").append("categoryBigimgid:").append(categoryBigimgid.value!=null?categoryBigimgid:"").append(" ").append("categoryLittleimgname:").append(categoryLittleimgname.value!=null?categoryLittleimgname:"").append(" ").append("categoryBigimgname:").append(categoryBigimgname.value!=null?categoryBigimgname:"").append(" ").append("categoryLittleimgpath:").append(categoryLittleimgpath.value!=null?categoryLittleimgpath:"").append(" ").append("categoryBigimgpath:").append(categoryBigimgpath.value!=null?categoryBigimgpath:"").append(" ").append("categoryLittleimgsize:").append(categoryLittleimgsize.value!=null?categoryLittleimgsize:"").append(" ").append("categoryBigimgsize:").append(categoryBigimgsize.value!=null?categoryBigimgsize:"").append(" ");
		return str.toString();
	}
	
}
